.TH "static-mem" 3 "Sun Sep 2 2018" "Version 2.0" "liblightmodbus" \" -*- nroff -*-
.ad l
.nh
.SH NAME
static-memDisabling dynamic memory allocation 
 \- In embedded applications it's often desirable to avoid dynamic memory allocation for performance and/or safety reasons\&. In its configuration process, liblightmodbus allows user to disable dynamic memory allocation\&.
.PP
Defining following CMake variables during configuration will have effect on the way memory is allocated in certain places:
.IP "\(bu" 2
STATIC_MEM_SLAVE_REQUEST - replaces \fBModbusSlave::request\fP frame pointer with fixed-size buffer
.IP "\(bu" 2
STATIC_MEM_SLAVE_RESPONSE - replaces \fBModbusSlave::response\fP frame pointer with fixed-size buffer
.IP "\(bu" 2
STATIC_MEM_MASTER_REQUEST - replaces \fBModbusMaster::request\fP frame pointer with fixed-size buffer
.IP "\(bu" 2
STATIC_MEM_MASTER_RESPONSE - replaces \fBModbusMaster::response\fP frame pointer with fixed-size buffer
.IP "\(bu" 2
STATIC_MEM_MASTER_DATA - replaces \fBModbusMaster::data\fP coil and registers data pointers with fixed-size buffers
.PP
.PP
\fBWarning:\fP
.RS 4
\fCSTATIC_MEM_MASTER_DATA\fP and \fCNO_MASTER_DATA_BUFFER\fP modules cannot be used at once\&.
.RE
.PP
For example, following CMake invocation configures the library so that the slave's request buffer is only 128 bytes long\&. 
.PP
.nf
cmake -DSTATIC_MEM_SLAVE_REQUEST=128 ..

.fi
.PP
.PP
For more information on how to build the library, see \fBBuilding liblightmodbus\fP\&. 
